﻿@model Wheeler.Web.ViewModels.TestResultViewModel
@using Wheeler.Common.Xml;
@using Wheeler.Web.ViewModels;
@using Wheeler.Common.Extensions;

@{
    VehicleViewModel _Vehicle = Model.Vehicle;
    List<Wheeler.Web.ViewModels.ZGL.Category.ProductGroupProperty> _Properties = ViewData[AppConstants.ViewDataKeys.GENERIC_KEY] as List<Wheeler.Web.ViewModels.ZGL.Category.ProductGroupProperty>;
    //Wheeler.Web.ViewModels.ZGL.Product.Product _Properties = XmlHelper.ToObject<Wheeler.Web.ViewModels.ZGL.Product.Product>(Model.DynamicProperties);
    Wheeler.Web.ViewModels.ZGL.Category.ProductGroupProperty _Property = null;
    bool _IsEditMode = ViewData[AppConstants.ViewDataKeys.SECONDARY_MODEL] == null ? true : false;
    bool _PrintMode = ViewData[AppConstants.ViewDataKeys.PRINT_MODE] == null ? false : true;
    bool _IsDataSheetPrintMode = ViewData[AppConstants.ViewDataKeys.IMAGE_UPLOAD_ERROR] == null ? false : true;
    
    if(_PrintMode){
        _IsEditMode = false;
    }
    UIProvider _Provider = new UIProvider(_Properties, _IsEditMode);
    //if(Model.ID == 0) {
    //    Model.SerialNumber = "3WCNG";
    //}
}

@functions{
    public class UIProvider
    {

        public UIProvider(List<Wheeler.Web.ViewModels.ZGL.Category.ProductGroupProperty> properties, bool isEditMode)
        {
            this.Properties = properties;
            this.IsEdit = isEditMode;
        }
        public List<Wheeler.Web.ViewModels.ZGL.Category.ProductGroupProperty> Properties { get; set; }
        public bool IsEdit { get; set; }

        public String GetName(String key)
        {
            return String.Format("{0}{1}", AppConstants.UI.DYNAMIC_CONTROL_PREFIX, key);
        }
        public MvcHtmlString GetTextBox(Wheeler.Web.ViewModels.ZGL.Category.ProductGroupProperty property, bool isLarge = true)
        {
            if (this.IsEdit)
            {
                String cssClass = isLarge ? "class=\"large\"" : String.Empty;
                return MvcHtmlString.Create(
                    String.Format("<input type=\"text\" id=\"{0}\" name=\"{0}\" value=\"{1}\"{2}/>", GetName(property.Name), property.Value, cssClass)
                    );
            }
            return MvcHtmlString.Create(property.Value);
            //return MvcHtmlString.Create(String.Format("<input type='text' name='{0}' id='{0}' value=''/>", GetName(key)));
        }
        public MvcHtmlString GetRadio(Wheeler.Web.ViewModels.ZGL.Category.ProductGroupProperty property, bool isOk)
        {
            if (this.IsEdit)
            {
                return MvcHtmlString.Create(
                    String.Format("<input type=\"radio\" id=\"{0}_{1}\" name=\"{0}\" value=\"{1}\"{2} />",
                        GetName(property.Name), isOk ? "Y" : "N", isOk == property.Value.ToBoolean() ? "checked" : String.Empty)
                    );
            }
            return MvcHtmlString.Create(String.Format("<img src='/Content/Images/checkbox-{0}.png' class='img-checkbox'/>",
                isOk == property.Value.ToBoolean() ? "y" : "n")); // <i class='icon-{0}'></i>
            //return MvcHtmlString.Create(String.Format("<input type='text' name='{0}' id='{0}' value=''/>", GetName(key)));
        }

        public Wheeler.Web.ViewModels.ZGL.Category.ProductGroupProperty GetProperty(String name)
        {
            Wheeler.Web.ViewModels.ZGL.Category.ProductGroupProperty property = this.Properties.FirstOrDefault(P => String.Compare(P.Name, name, true) == 0);
            return property;
        }
        
        public MvcHtmlString Evaluate(String values, bool isOk){
            String[] parts = values.Split(',');
            Wheeler.Web.ViewModels.ZGL.Category.ProductGroupProperty property = null;
            foreach(String part in parts){
                if(!part.IsNullOrEmpty()){
                   property = GetProperty(part.Trim());
                   if (property.Value.ToBoolean() != property.ReferenceValue.ToBoolean())
                       return GetRadio(property, isOk);
                }                
            }
            return GetRadio(property, isOk);
        }
    }
}

@{
    Random random = new Random();    
    String pictureUrl = String.Format("{0}?Rnd={1}", ImageManager.GetVehiclePhotoUrl(Model.Vehicle.PictureFile), random.Next(100));
    //String jsOnClick = String.Format("ShowCenteredPopUp('{0}', 'UploadImage', 1152, 600, true);", Url.Action("List", "CompanyLogo", new { ID = Model.ID }));
    String jsOnClick = "ShowPhotoEditDialog();";
    String altText = Model.Vehicle.PictureFile.IsNullOrEmpty() ? "Add New Picture" : "Change Picture";
}	
@if (!_PrintMode)
{
    if (!_IsDataSheetPrintMode)
    {
<div class="editor-field">
    @if (_IsEditMode)
    {
    <input id="Vehicle_PictureFile" name="Vehicle.PictureFile" type="hidden" value="@(Model.Vehicle.PictureFile)" data-val="true" data-val-length="The Picture can be maximum 50 characters long." data-val-length-max="50" data-val-required="Please Select a Picture for this Auto Rickshaw" />
    <a href="javascript:void(0);" onclick="@jsOnClick">Manage Picture</a>
    <ul class="thumbnails">
        <li class="span4__" style="width:auto; margin:5px 0px 0px 0px;">
            <a href="javascript:void(0);" class="thumbnail" onclick="@jsOnClick">
                <img id="imgVehiclePicture" src="@pictureUrl" alt="@altText" title="@altText" />
            </a>
        </li>
    </ul>
    @*@Html.ValidationMessageFor(model => model.Vehicle.PictureFile)*@
    <span class="field-validation-valid" data-valmsg-for="Vehicle.PictureFile" data-valmsg-replace="true"></span>
    }
    else
    {
        <ul class="thumbnails hidden-print">
            <li class="span4__" style="width:auto; margin:5px 0px 0px 0px;">
                <img id="imgVehiclePicture" src="@pictureUrl" alt="@altText" title="@altText" />
            </li>
        </ul>
    }
</div>
    }
    ///Datasheet Print Mode
    else {
        altText = Model.Vehicle.PictureFile;
        <div class="pic-container" style="margin-bottom:10px;">
            <img id="imgVehiclePicture" src="@pictureUrl" alt="@altText" title="@altText" />
        </div>
    }
<div class="row-fluid">
    <div class="span6">
        <table class="data-table-list">
            <colgroup>
                <col style="width:50%;" />
                <col />
            </colgroup>
            <tr>
                <td>BRTC Number</td>
                <td>@_Vehicle.BRTANumber</td>
            </tr>
            <tr>
                <td>Date of Inspection</td>
                <td>@( _IsEditMode ? Html.TextBoxFor(model => model.TestPerformedOn, new { @class = "datepicker large" }) : MvcHtmlString.Create(Model.TestPerformedOn.ToDateTime().ToString(AppConstants.ValueOf.DATE_FROMAT_DISPLAY)))</td>
            </tr>
            <tr>
                <td>Inspection Serial No.</td>
                <td>@( _IsEditMode ? Html.TextBoxFor(model => model.SerialNumber, new { @class = "large" }) : MvcHtmlString.Create(Model.SerialNumber))</td>
            </tr>
            <tr>
                <td>Registration No.</td>
                <td>@_Vehicle.RegistrationNo</td>
            </tr>
        </table>
    </div>
    <div class="span6">
        <table class="data-table-list">
            <colgroup>
                <col style="width:50%;" />
                <col />
            </colgroup>
            <tr>
                <td>Engine No.</td>
                <td>@_Vehicle.EngineNo</td>
            </tr>
            <tr>
                <td>Chassis No.</td>
                <td>@_Vehicle.ChasisNo</td>
            </tr>
            <tr>
                <td>CNG Cylinder No.</td>
                <td>@_Vehicle.CNGCylinderNo</td>
            </tr>
        </table>
    </div>
    @*<div class="clearfix"></div>*@
</div>

<div class="spacer"></div>

<div class="row-fluid">
    <div class="span12">
        <table class="data-table-list">
            <colgroup>
                @*<col style="width:33%;" />
                <col style="width:33%;" />*@
                <col />
                <col style="width:12%;" />
                <col style="width:13%;" />
            </colgroup>
            <tr>@{_Property = _Provider.GetProperty("CylinderTestDone");}
                <td>1a. CNG Cylinder Test Certificate (Done by CNG Workshop)</td>
                <td class="right"><label for="@_Provider.GetName("CylinderTestDone")_Y">OK</label> @_Provider.GetRadio(_Property, true)</td>
                <td class="right"><label for="@_Provider.GetName("CylinderTestDone")_N">NOT OK</label> @_Provider.GetRadio(_Property, false)</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("CNGSystemOk");}
                <td>1b. Checking of CNG System (Done by CNG Workshop)</td>
                <td class="right"><label for="@_Provider.GetName("CNGSystemOk")_Y">OK</label> @_Provider.GetRadio(_Property, true)@*<input type="radio" id="@_Provider.GetName("SprintStiffness")_Y" name="@_Provider.GetName("SprintStiffness")" value="Y" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("CNGSystemOk")_N">NOT OK</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("SprintStiffness")_N" name="@_Provider.GetName("SprintStiffness")" value="N" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("LogBookOk");}
                <td>2. Checking of LOG BOOK</td>
                <td class="right"><label for="@_Provider.GetName("LogBookOk")_Y">OK</label> @_Provider.GetRadio(_Property, true)@*<input type="radio" id="@_Provider.GetName("SprintStiffness")_Y" name="@_Provider.GetName("SprintStiffness")" value="Y" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("LogBookOk")_N">NOT OK</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("SprintStiffness")_N" name="@_Provider.GetName("SprintStiffness")" value="N" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
        </table>
    </div>
</div>

<div class="spacer"></div>

<div class="row-fluid">
    <div class="span6">
        <table class="data-table-list">
            <colgroup>
                <col style="width:47%;" />
                <col style="width:3%;" />
                <col />
                <col />
            </colgroup>
            <tr>
                <th colspan="4">3a. Physical Inspection: Components</th>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("Horn");}
                <td colspan="2">a. Horn</td>
                <td class="right"><label for="@_Provider.GetName("Horn")_Y">OK</label> @_Provider.GetRadio(_Property, true)@* <input type="radio" id="@_Provider.GetName("Horn")_Y" name="@_Provider.GetName("Horn")" value="Y" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("Horn")_N">NOT OK</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("Horn")_N" name="@_Provider.GetName("Horn")" value="N" @(!_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("HeadLight");}
                <td colspan="2">b. Head Light</td>
                <td class="right"><label for="@_Provider.GetName("HeadLight")_Y">OK</label> @_Provider.GetRadio(_Property, true)@*<input type="radio" id="@_Provider.GetName("HeadLight")_Y" name="@_Provider.GetName("HeadLight")" value="Y" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("HeadLight")_N">NOT OK</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("HeadLight")_N" name="@_Provider.GetName("HeadLight")" value="N" @(!_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("IndicatorLights");}
                <td colspan="2">c. Indicator Lights</td>
                <td class="right"><label for="@_Provider.GetName("IndicatorLights")_Y">OK</label> @_Provider.GetRadio(_Property, true)@*<input type="radio" id="@_Provider.GetName("IndicatorLights")_Y" name="@_Provider.GetName("IndicatorLights")" value="Y" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("IndicatorLights")_N">NOT OK</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("IndicatorLights")_N" name="@_Provider.GetName("IndicatorLights")" value="N" @(!_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("Wiper");}
                <td colspan="2">d. Wiper</td>
                <td class="right"><label for="@_Provider.GetName("Wiper")_Y">OK</label> @_Provider.GetRadio(_Property, true)@*<input type="radio" id="@_Provider.GetName("Wiper")_Y" name="@_Provider.GetName("Wiper")" value="Y" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("Wiper")_N">NOT OK</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("Wiper")_N" name="@_Provider.GetName("Wiper")" value="N" @(!_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("WiperAutomatic");}
                <td class="right">If Yes,</td>
                <td class="right" colspan="2"><label for="@_Provider.GetName("WiperAutomatic")_Y">Automatic</label> @_Provider.GetRadio(_Property, true)@*<input type="radio" id="@_Provider.GetName("WiperAutomatic")_Y" name="@_Provider.GetName("WiperAutomatic")" value="Y" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("WiperAutomatic")_N">Manual</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("WiperAutomatic")_N" name="@_Provider.GetName("WiperAutomatic")" value="N" @(!_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("LookingMirrors");}
                <td colspan="2">e. Looking Mirrors</td>
                <td class="right"><label for="@_Provider.GetName("LookingMirrors")_Y">OK</label> @_Provider.GetRadio(_Property, true)@*<input type="radio" id="@_Provider.GetName("Hood")_Y" name="@_Provider.GetName("Hood")" value="Y" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("LookingMirrors")_N">NOT OK</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("Hood")_N" name="@_Provider.GetName("Hood")" value="N" @(!_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
            
            <tr>@{_Property = _Provider.GetProperty("Hood");}
                <td colspan="2">f. New Hood</td>
                <td class="right"><label for="@_Provider.GetName("Hood")_Y">OK</label> @_Provider.GetRadio(_Property, true)@*<input type="radio" id="@_Provider.GetName("Hood")_Y" name="@_Provider.GetName("Hood")" value="Y" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("Hood")_N">NOT OK</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("Hood")_N" name="@_Provider.GetName("Hood")" value="N" @(!_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("Seat");}
                <td colspan="2">g. New Seat</td>
                <td class="right"><label for="@_Provider.GetName("Seat")_Y">OK</label> @_Provider.GetRadio(_Property, true)@*<input type="radio" id="@_Provider.GetName("Seat")_Y" name="@_Provider.GetName("Seat")" value="Y" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("Seat")_N">NOT OK</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("Seat")_N" name="@_Provider.GetName("Seat")" value="N" @(!_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
        </table>
    </div>

    <div class="span6">
        <table class="data-table-list">
            <colgroup>
                <col style="width:50%;" />
                <col />
                <col />
                <col />
            </colgroup>
            <tr>
                <th colspan="3">3b. Physical Inspection: Exterior</th>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("VisibleDent");}
                <td>a. Visible Dents</td>
                <td class="right"><label for="@_Provider.GetName("VisibleDent")_Y">OK</label> @_Provider.GetRadio(_Property, true)@*<input type="radio" id="@_Provider.GetName("VisibleDent")_Y" name="@_Provider.GetName("VisibleDent")" value="Y" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("VisibleDent")_N">NOT OK</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("VisibleDent")_N" name="@_Provider.GetName("VisibleDent")" value="N" @(!_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("Paint");}
                <td>b. Paint</td>
                <td class="right"><label for="@_Provider.GetName("Paint")_Y">Spray</label> @_Provider.GetRadio(_Property, true)@*<input type="radio" id="@_Provider.GetName("Paint")_Y" name="@_Provider.GetName("Paint")" value="Y" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("Paint")_N">Brush</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("Paint")_N" name="@_Provider.GetName("Paint")" value="N" @(!_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
            <tr>
                <td rowspan="3">c. Min. thickness of the Sheet Material of the Body</td>
                <td class="center">Min</td>
                <td class="center">Measured</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("ThicknessOfSheet");}
                <td class="center"><label>@_Property.ReferenceValue</label></td>
                <td class="center">@_Provider.GetTextBox(_Property, false)@*<input type="text" id="@_Provider.GetName("ThicknessOfSheet")" name="@_Provider.GetName("ThicknessOfSheet")" value="@_Property.Value" />*@</td>
            </tr>

            <tr>@{_Property = _Provider.GetProperty("ThicknessOfSheetOk");}
                <td class="right"><label for="@_Provider.GetName("ThicknessOfSheetOk")_Y">OK</label> @_Provider.GetRadio(_Property, true)@*<input type="radio" id="@_Provider.GetName("ThicknessOfSheetOk")_Y" name="@_Provider.GetName("ThicknessOfSheetOk")" value="Y" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("ThicknessOfSheetOk")_N">NOT OK</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("ThicknessOfSheetOk")_N" name="@_Provider.GetName("ThicknessOfSheetOk")" value="N" @(!_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("Windshield");}
                <td>d. Windshield</td>
                <td class="right"><label for="@_Provider.GetName("Windshield")_Y">OK</label> @_Provider.GetRadio(_Property, true)@*<input type="radio" id="@_Provider.GetName("BumperAppearance")_Y" name="@_Provider.GetName("BumperAppearance")" value="Y" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("Windshield")_N">NOT OK</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("BumperAppearance")_N" name="@_Provider.GetName("BumperAppearance")" value="N" @(!_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("BumperAppearance");}
                <td>e. Bumper Appearance</td>
                <td class="right"><label for="@_Provider.GetName("BumperAppearance")_Y">OK</label> @_Provider.GetRadio(_Property, true)@*<input type="radio" id="@_Provider.GetName("BumperAppearance")_Y" name="@_Provider.GetName("BumperAppearance")" value="Y" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("BumperAppearance")_N">NOT OK</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("BumperAppearance")_N" name="@_Provider.GetName("BumperAppearance")" value="N" @(!_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
        </table>
    </div>
</div>

<div class="spacer"></div>

<div class="row-fluid">
    <div class="span12">
        <table class="data-table-list">
            <colgroup>
                <col style="width:33%;" />
                <col style="width:33%;"  />
                <col />
                <col style="width:12%;" />
                <col style="width:13%;" />
            </colgroup>
            <tr>
                <th colspan="5">4. Suspension Test</th>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("SprintStiffness");}
                <td colspan="3">a. Spring Stiffness Test at 300 kg Load</td>
                <td class="right"><label for="@_Provider.GetName("SprintStiffness")_Y">OK</label> @_Provider.GetRadio(_Property, true)@*<input type="radio" id="@_Provider.GetName("SprintStiffness")_Y" name="@_Provider.GetName("SprintStiffness")" value="Y" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("SprintStiffness")_N">NOT OK</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("SprintStiffness")_N" name="@_Provider.GetName("SprintStiffness")" value="N" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
            <tr>
                <td class="center"></td>
                <td class="center">Specified Value</td>
                <td class="center" colspan="3">Measured Value</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("SprintStiffnessValue");}
                <td>(Left +Right Wheel)/2 :</td>
                <td class="center">@(_Property.ReferenceValue) mm</td>
                <td class="center" colspan="3">@_Provider.GetTextBox(_Property) mm@*<input class="large" type="text" id="@_Provider.GetName("SprintStiffnessValue")" name="@_Provider.GetName("SprintStiffnessValue")" value="@_Property.Value" />*@</td>
            </tr>
        </table>
    </div>
</div>

<div class="spacer"></div>

<div class="row-fluid">
    <div class="span12">
        <table class="data-table-list">
            <colgroup>
                <col style="width:33%;" />
                <col style="width:33%;"  />
                <col />
                <col style="width:12%;" />
                <col style="width:13%;" />
            </colgroup>
            <tr>
                <th colspan="5">5. Steering Test</th>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("TurningRadius");}
                <td colspan="3">6. Turning Radius</td>
                <td class="right"><label for="@_Provider.GetName("TurningRadius")_Y">OK</label> @_Provider.GetRadio(_Property, true)@*<input type="radio" id="@_Provider.GetName("TurningRadius")_Y" name="@_Provider.GetName("TurningRadius")" value="Y" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("TurningRadius")_N">NOT OK</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("TurningRadius")_N" name="@_Provider.GetName("TurningRadius")" value="N" @(!_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
            <tr>
                <td class="center">(300kg Loaded)</td>
                <td class="center">Specified Value DOE</td>
                <td class="center" colspan="3">Measured Value</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("TurningRadiusValue");}
                <td class="center">Angle (L,R)</td>
                <td class="center">@_Property.ReferenceValue</td>
                <td class="center" colspan="3">@_Provider.GetTextBox(_Property)@*<input class="large" type="text" id="@_Provider.GetName("TurningRadiusValue")" name="@_Provider.GetName("TurningRadiusValue")" value="@_Property.Value" />*@</td>
            </tr>
        </table>
    </div>
</div>

<div class="spacer"></div>

<div class="row-fluid">
    <div class="span12">
        <table class="data-table-list">
            <colgroup>
                <col style="width:33%;" />
                <col style="width:33%;"  />
                <col />
                <col style="width:12%;" />
                <col style="width:13%;" />
            </colgroup>
            <tr>
                <th colspan="5">6. Engine Test</th>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("EmissionIdle");}
                <td colspan="3">a. Emission Test in Idle Condition</td>
                <td class="right"><label for="@_Provider.GetName("EmissionIdle")_Y">OK</label> @_Provider.GetRadio(_Property, true)@*<input type="radio" id="@_Provider.GetName("EmissionIdle")_Y" name="@_Provider.GetName("EmissionIdle")" value="Y" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("EmissionIdle")_N">NOT OK</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("EmissionIdle")_N" name="@_Provider.GetName("EmissionIdle")" value="N" @(!_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
            <tr>
                <td class="center">Species</td>
                <td class="center">DOE Specified Value</td>
                <td class="center" colspan="3">Measured Value</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("CO");}
                <td>CO<sub>corr</sub> %volm (CO%)</td>
                <td class="center">@(_Property.ReferenceValue)% volm</td>
                <td class="center" colspan="3">@_Provider.GetTextBox(_Property)@*<input class="large" type="text" id="@_Provider.GetName("CO")" name="@_Provider.GetName("CO")" value="@_Property.Value" />*@</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("CO2");}
                <td>CO<sub>2</sub></td>
                <td class="center">@(_Property.ReferenceValue)</td>
                <td class="center" colspan="3">@_Provider.GetTextBox(_Property)@*<input class="large" type="text" id="@_Provider.GetName("CO2")" name="@_Provider.GetName("CO2")" value="@_Property.Value" />*@</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("NO");}
                <td>NO ppm</td>
                <td class="center">@_Property.ReferenceValue</td>
                <td class="center" colspan="3">@_Provider.GetTextBox(_Property)@*<input class="large" type="text" id="@_Provider.GetName("NO")" name="@_Provider.GetName("NO")" value="@_Property.Value" />*@</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("UnburntHC");}
                <td>Unburnt HC ppm</td>
                <td class="center">@_Property.ReferenceValue</td>
                <td class="center" colspan="3">@_Provider.GetTextBox(_Property)@*<input class="large" type="text" id="@_Provider.GetName("UnburntHC")" name="@_Provider.GetName("UnburntHC")" value="@_Property.Value" />*@</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("O2");}
                <td>Remaining O<sub>2</sub> %volm</td>
                <td class="center">@_Property.ReferenceValue</td>
                <td class="center" colspan="3">@_Provider.GetTextBox(_Property)</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("OilLeaks");}
                <td>Oil Leaks</td>
                <td class="center">@_Property.ReferenceValue</td>
                <td class="center" colspan="3">
                    @if (_IsEditMode)
                    {
                    <label for="@_Provider.GetName("OilLeaks")_Y">Has Leakage</label> @_Provider.GetRadio(_Property, true)
                    <label for="@_Provider.GetName("OilLeaks")_N">No Leakage</label> @_Provider.GetRadio(_Property, false)
                    }
                    else
                    {
                        if (_Property.Value.ToBoolean())
                        {
                            <text>Has Leakage</text>
                        }
                        else
                        {
                            <text>No Leakage</text>
                        }

                    }
                </td>
            </tr>
            
            <tr>@{_Property = _Provider.GetProperty("NoiseMeasurement");}
                <td colspan="3">b. Noise Measurement</td>
                <td class="right"><label for="@_Provider.GetName("NoiseMeasurement")_Y">OK</label> @_Provider.GetRadio(_Property, true)@*<input type="radio" id="@_Provider.GetName("NoiseMeasurement")_Y" name="@_Provider.GetName("NoiseMeasurement")" value="Y" @(!_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("NoiseMeasurement")_N">NOT OK</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("NoiseMeasurement")_N" name="@_Provider.GetName("NoiseMeasurement")" value="N" @(!_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
            <tr>
                <td class="center">Scale</td>
                <td class="center">DOE Specified Value </td>
                <td class="center" colspan="3">Measured Value</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("NoiseMeasurementValue");}
                <td class="center">Scale-A, Fast</td>
                <td class="center">@(_Property.ReferenceValue) db</td>
                <td class="center" colspan="3">@_Provider.GetTextBox(_Property) db@*<input class="large" type="text" id="@_Provider.GetName("NoiseMeasurementValue")" name="@_Provider.GetName("NoiseMeasurementValue")" value="@_Property.Value" />*@</td>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("RampTest");}
                <td colspan="3">c. Ramp Test (3 Person + Driver) at Autoshop Ramp</td>
                <td class="right"><label for="@_Provider.GetName("RampTest")_Y">OK</label> @_Provider.GetRadio(_Property, true)@*<input type="radio" id="@_Provider.GetName("RampTest")_Y" name="@_Provider.GetName("RampTest")" value="Y" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("RampTest")_N">NOT OK</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("RampTest")_N" name="@_Provider.GetName("RampTest")" value="N" @(!_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
        </table>
    </div>
</div>

<div class="spacer"></div>

<div class="row-fluid">
    <div class="span12">
        <table class="data-table-list">
            <colgroup>
                <col style="width:33%;" />
                <col style="width:33%;"  />
                <col />
                <col style="width:12%;" />
                <col style="width:13%;" />
            </colgroup>
            <tr>
                <th colspan="5">7. Brake Test</th>
            </tr>
            <tr>@{_Property = _Provider.GetProperty("MotionOnRamp");}
                <td colspan="3">a. Intermittent stops during downward motion on ramp</td>
                <td class="right"><label for="@_Provider.GetName("MotionOnRamp")_Y">OK</label> @_Provider.GetRadio(_Property, true)@*<input type="radio" id="@_Provider.GetName("MotionOnRamp")_Y" name="@_Provider.GetName("MotionOnRamp")" value="Y" @(_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
                <td class="right"><label for="@_Provider.GetName("MotionOnRamp")_N">NOT OK</label> @_Provider.GetRadio(_Property, false)@*<input type="radio" id="@_Provider.GetName("MotionOnRamp")_N" name="@_Provider.GetName("MotionOnRamp")" value="N" @(!_Property.Value.ToBoolean() ? "checked" : "")/>*@</td>
            </tr>
            <tr>
                <td colspan="5">&nbsp;&nbsp;&nbsp; At Autoshop Ramp, Two stops downwards + Push, should fully restrict motion</td>
            </tr>
        </table>
    </div>
</div>
}

@*Print mode starts from here*@
else
{
    <div class="print-bg">@*<img src="/Content/Images/buet_watermark_l1.png" alt="" title="" />*@
    <table class="print-container">
        <colgroup>
            <col style="width:50%;" />
            <col style="width:50%;" />
        </colgroup>
        <tr>
            @*Left Column Start*@
            <td style="padding-right:10px; vertical-align:top;">
                <div class="print-heading">
                    <h1>থ্রি হুইলার সিএনজি অটোরিক্সা<br />
                    কারিগরি পরীক্ষা প্রকল্প</h1>                    
                    যন্ত্রকৌশল বিভাগ<br />
                    বাংলাদেশ প্রকৌশল বিশ্ববিদ্যালয় (বুয়েট), ঢাকা-১০০০
                </div>
                <div class="spacer" style="margin-top:-5px;"></div>
                <table class="print">
                    <colgroup>
                        <col style="width:34%;" />
                        <col />
                    </colgroup>
                    <tr>
                        <td class="top caption">রেজিষ্ট্রেশন নং</td>
                        <td class="top right">@Model.Vehicle.RegistrationNo</td>
                    </tr>
                    <tr>
                        <td class="caption">ইঞ্জিন নং</td>
                        <td class="right">@Model.Vehicle.EngineNo</td>
                    </tr>
                    <tr>
                        <td class="caption">চেসিস নং</td>
                        <td class="right">@Model.Vehicle.ChasisNo</td>
                    </tr>
                    <tr>
                        <td class="bottom caption">সিএনজি সিলিন্ডার নং</td>
                        <td class="bottom right">@Model.Vehicle.CNGCylinderNo</td>
                    </tr>
                </table>

                <div class="spacer-right"></div>

                <table class="print">
                    <colgroup>
                        <col style="width:34%;" />
                        <col />
                    </colgroup>
                    <tr>
                        <td class="top caption">গ্রাহকের নাম</td>
                        <td class="right top">@Model.Vehicle.OwnerName</td>
                    </tr>
                    <tr>
                        <td class="caption" style="height:42px;">গ্রাহকের ঠিকানা</td>
                        <td class="right">@Model.Vehicle.Address</td>
                    </tr>
                    <tr>
                        <td class="bottom caption">মোবাইল নম্বর</td>
                        <td class="bottom right">@Model.Vehicle.CellPhone</td>
                    </tr>
                </table>

                <div class="spacer-right"></div>

                <table class="print">
                    <colgroup>
                        <col style="width:34%;" />
                        <col />
                    </colgroup>
                    <tr>
                        <td class="top caption">বুয়েট বিআরটিসি নং</td>
                        <td class="top right">@Model.Vehicle.BRTANumber</td>
                    </tr>
                    <tr>
                        <td class="caption">পরীক্ষার তারিখ</td>
                        <td class="right">@Model.TestPerformedOn.ToDateTime(ConfigReader.CSharpCalendarDateFormat).ToString("dd/MM/yyyy")</td>
                    </tr>
                    <tr>
                        <td class="bottom caption">টেস্ট সিরিয়াল নং</td>
                        <td class="bottom right">@Model.SerialNumber</td>
                    </tr>
                </table>

                <div class="spacer-right"></div>

                <table class="print">
                    <colgroup>
                        <col style="width:80%;" />
                        <col style="width:10%;" />
                        <col />
                    </colgroup>
                    <tr>
                        <td class="none"></td>
                        <td class="center top left yes">হ্যাঁ</td>
                        <td class="center top right no">না</td>
                    </tr>
                    <tr>
                        <td class="top caption">ইঞ্জিন, ট্রান্সমিশন, ব্রেক ও সাসপেনশন গুনগত মানসম্পন্ন কিনা?</td>
                        <td class="center yes">@_Provider.Evaluate("EmissionIdle,MotionOnRamp,RampTest,SprintStiffness", true)</td>
                        <td class="center no">@_Provider.Evaluate("EmissionIdle,MotionOnRamp,RampTest,SprintStiffness", false)</td>
                    </tr>
                    <tr>@{_Property = _Provider.GetProperty("TurningRadius");}
                        <td class="caption">টার্নিং রেডিয়াস ঠিক আছে কিনা?</td>
                        <td class="center yes">@_Provider.GetRadio(_Property, true)</td>
                        <td class="center no">@_Provider.GetRadio(_Property, false)</td>
                    </tr>
                    <tr>
                        <td class="bottom caption">হর্ন, হেডলাইট, ইন্ডিকেটর, মিরর ও ওয়াইপার কার্যকর কিনা?</td>
                        <td class="center bottom yes">@_Provider.Evaluate("Horn,HeadLight,IndicatorLights,Wiper", true)</td>
                        <td class="center bottom no">@_Provider.Evaluate("Horn,HeadLight,IndicatorLights,Wiper", false)</td>
                    </tr>
                </table>
            </td>
            @*End of Left Column*@
            @*Right Column Start*@
            <td style="padding-left:10px; vertical-align:top;">
                <div class="pic-container">
                    <img src="@(pictureUrl)" alt="@altText" title="@altText" />
                </div>
                <div class="reg-no">@Model.Vehicle.RegistrationNo</div>
                
                <table class="print">
                    <colgroup>
                        <col style="width:20px;" />
                        <col />
                        <col style="width:10%;" />
                        <col style="width:10%;" />
                    </colgroup>
                    <tr>
                        <td class="none" colspan="2" style="font-size:10pt;">নিম্নলিখিত কাজগুলো করা হয়েছে কিনা?</td>
                        <td class="center top left yes">হ্যাঁ</td>
                        <td class="center top right no">না</td>
                    </tr>                    
                    <tr>
                        <td class="top right-none caption">ক)</td>
                        <td class="top left-none caption">সম্পূর্ণ ইঞ্জিন Overhauling করা।</td> 
                        <td class="center yes">@_Provider.Evaluate("EmissionIdle", true)</td>
                        <td class="center no">@_Provider.GetRadio(_Property, false)</td>
                    </tr>
                    <tr>
                        <td class="right-none caption">খ)</td>
                        <td class="left-none caption">অটোরিকশার হুড কভার ও সিট প্রতিস্হাপন করা এবং বডি রং করা।</td>
                        <td class="center yes">@_Provider.Evaluate("Hood,Seat,Paint", true)</td>
                        <td class="center no">@_Provider.Evaluate("EmissionIdle", false)</td>
                    </tr>
                    <tr>
                        <td class="right-none caption">গ)</td>
                        <td class="left-none caption">বডি, সাসপেনশন, ব্রেক, ট্রান্সমিশন ইত্যাদি অংশের প্রয়োজনীয় মেরামত করা। </td>
                        <td class="center yes">@_Provider.Evaluate("VisibleDent,Paint,ThicknessOfSheetOk,Windshield,BumperAppearance,MotionOnRamp,RampTest,SprintStiffness", true)</td>
                        <td class="center no">@_Provider.Evaluate("VisibleDent,Paint,ThicknessOfSheetOk,Windshield,BumperAppearance,MotionOnRamp,RampTest,SprintStiffness", false)</td>
                    </tr>
                    <tr>@{_Property = _Provider.GetProperty("CylinderTestDone");}
                        <td class="right-none caption">ঘ)</td>
                        <td class="left-none caption">সরকার অনুমোদিত ওয়ার্কশপ থেকে হাই প্রেসার সিএনজি সিলিন্ডারের হাইড্রলিক প্রেসার টেস্ট করা।</td>
                        <td class="center yes">@_Provider.GetRadio(_Property, true)</td>
                        <td class="center no">@_Provider.GetRadio(_Property, false)</td>
                    </tr>
                    <tr>@{_Property = _Provider.GetProperty("CNGSystemOk");}
                        <td class="right-none caption">ঙ)</td>
                        <td class="left-none caption">সিএনজি ফুয়েল সিস্টেমের অন্যান্য অংশগুলিও পরীক্ষা করে কার্যকারিতা নিশ্চিত করা।</td>
                        <td class="center yes">@_Provider.GetRadio(_Property, true)</td>
                        <td class="center no">@_Provider.GetRadio(_Property, false)</td>
                    </tr>
                    <tr>@{_Property = _Provider.GetProperty("LogBookOk");}
                        <td class="bottom right-none caption">চ)</td>
                        <td class="bottom left-none caption">Overhauling ও মেরামতের Log বই সংরক্ষন করা।</td>
                        <td class="center bottom yes">@_Provider.GetRadio(_Property, true)</td>
                        <td class="center bottom no">@_Provider.GetRadio(_Property, false)</td>
                    </tr>
                </table>

                <div class="spacer"></div>
                <div style="text-align:center;">
                    <div class="bangla" style="display:inline;">রেজিঃ নং</div> <div style="display:inline; border-bottom:#666666 1px dashed;font-family:Verdana; font-weight:bold;">&nbsp;&nbsp;@(Model.Vehicle.RegistrationNo)&nbsp;&nbsp;</div> <div class="bangla" style="display:inline;">থ্রি হুইলার সিএনজি 
                    অটোরিক্সাটিকে কারিগরি ভাবে মানসম্মত পাওয়া গিয়েছে।</div>
                </div>
                <table style="width:100%; border-collapse:collapse; margin-top:60px;">
                    <tr>
                        <td class="bangla" style="width:35%; border-top:#000000 1px solid; padding-top:1px; text-align:center;">পরীক্ষকের স্বাক্ষর</td>
                        <td></td>
                        <td class="bangla" style="width:35%; border-top:#000000 1px solid; padding-top:1px; text-align:center;">নিরীক্ষকের স্বাক্ষর</td>
                    </tr>
                </table>
                
                
            </td>
            @*End of Right Column*@
        </tr>
    </table>
    </div>
    @*<div class="print-bg"><img src="/Content/Images/buet_watermark_l1.png" alt="" title="" /></div>*@
}
@*Print mode end*@


